package com.bj.service;

import com.bj.mapper.auto.ChannelInfosMapper;
import com.bj.model.auto.ChannelInfos;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ChannelService {
    @Autowired
    private ChannelInfosMapper channelInfosMapper;

    public ChannelInfos findChannelInfosById(Long id){
        return channelInfosMapper.selectByPrimaryKey(id);
    }

    public PageInfo findAllChannelInfosByPage(int pageNum, int pageSize) {
        return PageHelper.startPage(pageNum,pageSize).doSelectPageInfo(()->channelInfosMapper.findAllChannelInfos());
    }
}
